//データを取得するための関数、Ajaxのラッパ
function ConnectToServerBySlideContents(axis_id, contents_id, async, q, dist_from_focus,hold_axis_id){
    var send_data = new Object();
    send_data['type'] = 0;
    send_data['clicked_axis_id'] = axis_id;
    send_data['center_cell_id'] = contents_id;
    send_data['query'] = q;
    send_data['dist_from_focus'] = dist_from_focus;
    send_data['hold'] = hold_axis_id;
    send_data['order'] = axis_order.join('_');
    if (async == undefined) {
        async = true;
    }
    var recieve_data = "";
    loading = true;
    jQuery.ajax({
        type: "GET",
        url: settings.url + "top/data",
        async: async,
        data: send_data,
        dataType: "json",
        success: function(data, dataType){
            //通信が成功したときの処理
            //dataTypeにjsonのオブジェクトが入るので
            //受信したデータを表示
            display_obj(data);
            loading = false;
        }
    });
}

//検索フォームをSubmitした際に呼ばれる関数、Ajaxのラッパ
function ConnectToServerBySubmitQueryContents(axis_id, contents_id, async, q, dist_from_focus,hold_axis_id){
    var send_data = new Object();
    send_data['type'] = 0;
    send_data['clicked_axis_id'] = axis_id;
    send_data['center_cell_id'] = contents_id;
    send_data['query'] = q;
    send_data['dist_from_focus'] = dist_from_focus;
    send_data['hold'] = hold_axis_id;
    send_data['submit'] = true;
    //axis_order.unshift("Q" + q);
    send_data['order'] = axis_order.join('_');
    //console.log(q);
    if (async == undefined) {
        async = true;
    }
    var recieve_data = "";
    loading = true;
    jQuery.ajax({
        type: "GET",
        url: settings.url + "top/data",
        async: async,
        data: send_data,
        dataType: "json",
        success: function(data, dataType){
            //通信が成功したときの処理
            //dataTypeにjsonのオブジェクトが入るので
            //受信したデータを表示
            display_obj(data);
            loading = false;
        }
    });
}



//軸変更のためのAjaxラッパ
function ConnectToServerByChangeAxis(clicked_axis_id, center_cell_id, async, query, hold_axis_id, axis_order){
    var send_data = new Object();
    //0が軸変更、1がコンテンツ変更
    send_data['type'] = 0;
    send_data['clicked_axis_id'] = clicked_axis_id;
    send_data['center_cell_id'] = center_cell_id;
    send_data['query'] = query;
    send_data['hold'] = hold_axis_id;
    send_data['order'] = axis_order.join('_');
    //console.log("send_sever");
    //console.log(axis_order);
    //console.log(send_data['order']);
    if (async == undefined) {
        async = true;
    }
    var recieve_data = "";
    loading = true;
    jQuery.ajax({
        type: "GET",
        url: settings.url + "top/data",
        async: async,
        data: send_data,
        dataType: "json",
        success: function(data, dataType){
            //通信が成功したときの処理
            //dataTypeにjsonのオブジェクトが入るので
            //受信したデータを表示
            display_obj(data);
            loading = false;
        }
    });
}

//軸固定のためのAjaxラッパ
function ConnectToServerByHoldAxis(clicked_axis_id, center_cell_id, async, query, hold_axis_id){
    var send_data = new Object();
    //0が軸変更、1がコンテンツ変更
    send_data['type'] = 0;
    send_data['clicked_axis_id'] = clicked_axis_id;
    send_data['center_cell_id'] = center_cell_id;
    send_data['hold'] = hold_axis_id;
    send_data['query'] = query;
    send_data['order'] = axis_order.join('_');
    if (async == undefined) {
        async = true;
    }
    var recieve_data = "";
    loading = true;
    jQuery.ajax({
        type: "GET",
        url: settings.url + "top/data",
        async: async,
        data: send_data,
        dataType: "json",
        success: function(data, dataType){
            //通信が成功したときの処理
            //dataTypeにjsonのオブジェクトが入るので
            //受信したデータを表示
            display_obj(data);
            loading = false;
        }
    });
}


